<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>资源搜索</title>
    <link rel="stylesheet" href="../css/resource-search.css"/>
    <script type="text/javascript" src="../js/space-resource-left.js"></script>
</head>

<body>
<!--**************顶部导航****************-->
<%@include file="../jsp/common/nav.jsp"%>
<!--**************左侧导航****************-->
<%@include file="../jsp/common/sidebar-scroll.jsp"%>
<!--***************右侧资源搜索界面*******************-->
<div class="right">
    <!--标题导航-->
    <div class="resource-nav">
        <span class="resource-nav-title"><a href="/index/main">学习空间</a></span>
        >
        <span class="resource-nav-title"><a href="/index/space-main?space_id=${space.id}&name=${space.name}">${space.name}</a></span>
        >
        <span class="resource-nav-title"><a href="/resource/space-resource">资源区</a></span>
        >
        <span>查找资源</span>
    </div>
    <!--搜索框-->
    <!--搜索框-->



    <div class="search-board">
        <form:form action="/resource/select" method="post">
            <div class="resource-name">
                <div class="name">按资源名</div>
                <input type="text" name="title" size="120" class="input"/>
            </div>
            <div class="resource-name">
                <div class="name">按作者</div>
                <input type="text" name="author" size="120" class="input"/>
            </div>
            <div class="resource-name">
                <div class="name">按标签</div>
                <input type="text" name="label" size="20" class="input"/>
            </div>
            <div class="resource-name">
                <input type="submit" class="submit" value="搜索"/>
            </div>
        </form:form>
    </div>
    <c:if test="${not empty selectlist}">
    <div class="resource-content">
        <div class="content-top">
            <div class="content1">
                <span class="content-name">资源名</span>
                <span class="writer">作者</span>
            </div>
            <div class="content2">
                <span class="detail">归属空间</span>
                <span class="date">更新时间</span>
            </div>
        </div>
        <!--搜索结果-->
        <c:forEach items="${selectlist}" var="list">
        <div class="resource-list">
            <ul>
                <li>
                    <div class="list">
                        <div class="content1">
                            <span class="list-name"><a href="#">${list.title}</a></span>
                            <span class="writer">${list.author}</span>
                        </div>
                        <div class="content2">
                            <span class="detail"><a href="/index/space-main?space_id=${space.id}&name=${space.name}">${space.name}</a></span>
                            <span class="date"><fmt:formatDate value="${list.updatetime}" pattern="yyyy年M月dd日"/></span>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        </c:forEach>
    </div>
    </c:if>
</div>
</body>
</html>
